package com.qiaofang.applet.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: youqing.yang
 * @Create: 2020/10/23 15:53
 * @Description:
 **/
@Getter
@AllArgsConstructor
public enum SignContactStatusEnum {

    WAIT_START("WAIT_START", "待发起签约"),
    SIGN_ING("SIGN_ING", "签约中"),
    SIGN_SUCCESS("SIGN_SUCCESS", "签约成功"),
    SIGN_FAIL("SIGN_FAIL", "签约失败"),
    CONTACT_CANCEL("CONTACT_CANCEL", "合同作废");

    private String code;

    private String value;

    public static String getValueByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return null;
        }
        for (SignContactStatusEnum item : values()) {
            if (StringUtils.equals(item.getCode(), code)) {
                return item.getValue();
            }
        }
        return null;
    }
}
